home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_integer_ref.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  897 b   |  52 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_INTEGER_REF
  5.  
  6. creation make
  7.    
  8. feature 
  9.    
  10.    make is
  11.       local
  12.      i: INTEGER;
  13.      ir: INTEGER_REF;
  14.      a: ANY;
  15.      aa: ARRAY[ANY];
  16.       do
  17.      ir := 2;
  18.      is_true(ir.item = 2);
  19.      a := 2;
  20.      is_true(equal(a,ir));
  21.      is_true(equal(ir,2));
  22.      is_true(equal(a,2));
  23.      
  24.      !!aa.make(1,1);
  25.      aa.put(26,1);
  26.      is_true(equal(aa.item(1),26));
  27.      
  28.      i := 5;
  29.      ir := i;
  30.      is_true(i = ir.item);
  31.      
  32.      ir.set_item(i);
  33.  
  34. -- ???     is_true(26 = aa.item(1));
  35.       end;
  36.    
  37.    is_true(b: BOOLEAN) is
  38.       do
  39.      cpt := cpt + 1;
  40.      if not b then
  41.         std_output.put_string("TEST_INTEGER_REF: ERROR Test # ");
  42.         std_output.put_integer(cpt);
  43.         std_output.put_string("%N");
  44.      else
  45.         --        std_output.put_string("Yes%N");
  46.      end;
  47.       end;
  48.    
  49.    cpt: INTEGER;
  50.    
  51. end -- TEST_INTEGER_REF
  52.